import Base from "./components/Base.vue";
import Spec from "./components/Spec.vue";
import Clear from "./components/Clear.vue";
import Sale from "./components/Sale.vue";
import ImageView from "./components/ImageView.vue";
import VideoView from "./components/VideoView.vue";

export const enum BlockKeys {
  base = "base",
  spec = "spec",
  clear = "clear",
  sale = "sale",
  image = "image",
  video = "video"
}

type CommonBlockExpose = {
  handleEdit?: () => Promise<void>;
  handleCancel?: () => Promise<void>;
  handleSave?: () => Promise<Record<string, any>>;
};

export interface BlockRefs {
  [BlockKeys.base]?: InstanceType<typeof Base> & CommonBlockExpose;
  [BlockKeys.spec]?: InstanceType<typeof Spec> & CommonBlockExpose;
  [BlockKeys.clear]?: InstanceType<typeof Clear> & CommonBlockExpose;
  [BlockKeys.sale]?: InstanceType<typeof Sale> & CommonBlockExpose;
  [BlockKeys.image]?: InstanceType<typeof ImageView> & CommonBlockExpose;
  [BlockKeys.video]?: InstanceType<typeof VideoView> & CommonBlockExpose;
}
